//
// Created by A4-28 on 2020/10/12.
//
#pragma once

#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtx/euler_angles.hpp>

namespace WF {
    class PerspectiveCamera {

    public:
        PerspectiveCamera();

        //计算matrix
        void ReCalculate();

        //更新视角 俯仰角(Pitch)、偏航角(Yaw)
        void Update();

        glm::mat4 GetViewMatrix();

        glm::mat4 GetProjectMatrix();

        glm::mat4 GetMVPMatrix();
        //旋转
        glm::vec3 Rotation = glm::vec3(0.0f, 0.0f, 0.0f);
        //位置
        glm::vec3 Position = glm::vec3(0.0f, 0.0f, 3.0f);

        glm::vec3 Forward;//前后
        glm::vec3 Right;//左右
        glm::vec3 Up;//上下
        glm::vec3 WorldUp = glm::vec3(0, 1.0f, 0);//世界轴
        //俯仰角(Pitch) 沿x轴旋转
        float Pitch = glm::radians(0.0f);
        //偏航角(Yaw)  沿y轴旋转
        float Yaw = glm::radians(180.0f);
        //翻滚角(Roll) 沿z轴旋转
        float Roll = glm::radians(0.0f);
        float FOV = 45.0f;//视野范围
        float width, height;
        float zNear = 0.1f, zFar = 100.0f;
        //view矩阵
        glm::mat4 viewMatrix;
        //投影矩阵
        glm::mat4 projectMatrix;
        //pv矩阵
        glm::mat4 projectVewMatrix;
    };
}



